package com.kun.portal.webframe.util.MessageFormatImp;

import com.kun.portal.webframe.po.AppointmentPo;
import com.kun.portal.webframe.util.MessageFormat;

import java.text.SimpleDateFormat;

/**
 * Created by Administrator on 2018-09-17.
 *
 * 修改预约信息格式化
 */
public class EditAppointment implements MessageFormat {
    private AppointmentPo appointmentPo;
    public EditAppointment (AppointmentPo appointmentPo){
        this.appointmentPo = appointmentPo;
    }
    @Override
    public String getMessageContext() {
        String context="";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日 HH点");
        String date = "";
        try{
            date=  simpleDateFormat.format(appointmentPo.getAppoDate());
        }catch (Exception e){
            e.printStackTrace();
        }
        context+= appointmentPo.getAppoUnit()+"单位的 "+ appointmentPo.getAppoName() +" 预约的 " +date +"的由"+ appointmentPo.getOriginating()+
                "飞往" +appointmentPo.getDestination() +"的航班预约信息已修改，请留意";
        return context;
    }
}
